package com.julian.templatePattern.javaAPI;

import java.util.Arrays;

public class DuckSortTestDrive {
    public static void main(String[] args) {
        Duck[] ducks = {
                new Duck("lunus",8),
                new Duck("Max", 9),
                new Duck("Mike",2),
                new Duck("Kim",1),
                new Duck("jobs",10),
        };
        System.out.println("Before sorting...");
        display(ducks);
        Arrays.sort(ducks);
        System.out.println("After sorting...");
        display(ducks);
    }

    public static void display(Duck[] ducks){
        for (int i=0; i < ducks.length; i++){
            System.out.println(ducks[i]);
        }
    }
}
